using Microsoft.AspNetCore.Mvc;
using net_work.Data.DTO.System;
using net_work.Data.Entity.System;

namespace net_work.IService.System;

public interface IFileService
{
    /// <summary>
    /// 上传文件
    /// </summary>
    /// <param name="file">文件</param>
    /// <param name="fileUseAddRequest">业务信息</param>
    /// <returns>是否成功</returns>
    Task<int> UploadFile(IFormFile file, FileUseAddRequest fileUseAddRequest);
    
    /// <summary>
    /// 删除文件
    /// </summary>
    /// <param name="ids">文件id列表</param>
    /// <returns>是否成功</returns>
    Task<int> DeleteFiles(List<long> ids);

    /// <summary>
    /// 获取文件列表
    /// </summary>
    /// <param name="fileUseAddRequest">业务信息</param>
    /// <returns>文件列表</returns>
    Task<List<MyFile>> GetFileList(FileUseAddRequest fileUseAddRequest);

    /// <summary>
    /// 下载文件
    /// </summary>
    /// <param name="myFileId">文件id</param>
    /// <returns>文件</returns>
    Task<FileStreamResult?> DownloadStream(long myFileId);
}